Google Streetview icon size icon automatically decreases

I use the Google Maps API v3 to display Google (StreetviewPanorama) and place markers in it.

This is similar to the usual Google Streetview, but with internal buildings, not a street.

I managed to place a marker in it with the following code:

var marker = new google.maps.Marker({
    position: streetview.getPosition(), // Test LatLng Position Value
    icon: {
        url: 'images/alert-icon.png',
        size: new google.maps.Size( hotspot.content.width, hotspot.content.height ),
        scaledSize: new google.maps.Size( hotspot.content.width, hotspot.content.height )
    },
    title: 'Alert',
    draggable: true,
    clickable: true,
    raiseOnDrag: false
});
marker.setMap( streetview );

The following issues:

  • At the beginning of Streetview, I need to โ€œMoveโ€ to another point to display the marker. Can I display it right at the beginning of StreetviewPanorama, and not after I move to another point?

  • To check the handles, I made them drag. If I drag them past the middle of the height panorama, the marker icon will begin to decrease its size.

Let me indicate "above the middle of the panorama-height":

Panorama Picture, , , . , . , .

, " " .

! :

var mouse_up = google.maps.event.addListener( marker, "mouseup", function( e ){
    console.log( marker.getPosition(), marker.getIcon() );
});

(hotspot.content.width height = 50px).

, . " " , , .

:

3 , 50 , 50 . , , .

, . , Highlightbox, " ". , .

- , ?

+4
1

, Google , " ", documentation. - .

, .

:

JSFiddle

, , , . .

POV. , , - , , .

panorama.setPov({
    heading: 200,
    zoom: 1,
    pitch: 30
});
+1

Source: https://habr.com/ru/post/1527703/


All Articles